import 'package:get/get.dart';

import '../business/womenhealth/page_chart_explain.dart';
import '../business/womenhealth/page_circular_explain.dart';
import '../business/womenhealth/page_cycle_calendar.dart';
import '../business/womenhealth/page_cycle_history.dart';
import '../business/womenhealth/page_explain_select.dart';
import '../business/womenhealth/page_main_health.dart';
import '../business/womenhealth/page_menstrual_setting.dart';
import '../business/womenhealth/page_menstrual_time.dart';
import '../business/womenhealth/page_period_length.dart';
import '../business/womenhealth/page_periodic_law.dart';
import '../business/womenhealth/page_physiological_cycle.dart';
import '../business/womenhealth/page_record_menstrual.dart';
import '../business/womenhealth/page_target_setting.dart';
import '../native/nativechannel.dart';
import 'constant.dart';

abstract class HealthPages {
  static final List<GetPage> pages = [
    //女性健康主界面
    GetPage(
        name: Native.HealthDataApp == 1
            ? PageIndex.mainHealthPage
            : PageIndex.mainFlutterHealthPage,
        page: () => MainHealthPage(),
        transition: Transition.rightToLeft),

    //生理周期
    GetPage(
        name: PageIndex.physiologicalCyclePage,
        page: () {
          final args = Get.arguments as Map<String, dynamic>;
          return PhysiologicalCyclePage(
            cycleValue: args['cycleValue']
          );
        },
        transition: Transition.rightToLeft),

    //经期长度
    GetPage(
        name: PageIndex.periodLengthPage,
        page: () {
          final args = Get.arguments as Map<String, dynamic>;
          return PeriodLengthPage(
            isReset: args["isReset"],
            cycleValue: args["cycleValue"],
            periodValue: args["periodValue"],
          );
        },
        transition: Transition.rightToLeft),

    //月经时间
    GetPage(
        name: PageIndex.menstrualTimePage,
        page: () {
          final args = Get.arguments as Map<String, dynamic>;
          return MenstrualTimePage(
              cycleValue: args["cycleValue"], periodValue: args["periodValue"]);
        },
        transition: Transition.rightToLeft),

    //月经周期规律
    GetPage(
        name: PageIndex.periodicLawPage,
        page: () {
          final args = Get.arguments as Map<String, dynamic>;
          return PeriodicLawPage(
            isReset: args["isReset"],
            regularly: args["regularly"],
            menstrualTime: args["menstrualTime"],
            cycleValue: args["cycleValue"],
            periodValue: args["periodValue"],
          );
        },
        transition: Transition.rightToLeft),

    //女性健康生理周期日历
    GetPage(
        name: PageIndex.cycleCalendarPage,
        page: () {
          final args = Get.arguments as Map<String, dynamic>;
          return CycleCalendarPage(
              userId: args["userId"],
              periodDataMap: args["periodDataMap"],
              menstrualTime: args["menstrualTime"],
              cycleValue: args["cycleValue"],
              periodValue: args["periodValue"],
              regularly: args["regularly"],
              tracking: args["tracking"]);
        },
        transition: Transition.rightToLeft),

    //女性健康生理周期历史
    GetPage(
        name: PageIndex.cycleHistoryPage,
        page: () {
          final args = Get.arguments as Map<String, dynamic>;
          return CycleHistoryPage(
            periodDataMap: args["periodDataMap"],
            menstrualTime: args["menstrualTime"],
            cycleValue: args["cycleValue"],
            periodValue: args["periodValue"]
          );
        },
        transition: Transition.rightToLeft),

    //女性健康生理周记录
    GetPage(
        name: PageIndex.recordMenstrualPage,
        page: () {
          final args = Get.arguments as Map<String, dynamic>;
          return RecordMenstrualPage(
            userId: args["userId"],
            recordTitle: args["recordTitle"],
            recordDay: args["recordDay"],
            recordDayTitle: args["recordDayTitle"],
            isMenstrualRecord: args["isMenstrualRecord"],
            recordMap: args["recordMap"],
          );
        },
        transition: Transition.rightToLeft),

    //女性健康生理经期设置
    GetPage(
        name: PageIndex.menstrualSettingPage,
        page: () {
          final args = Get.arguments as Map<String, dynamic>;
          return MenstrualSettingPage(
            menstrualTime: args["menstrualTime"],
            cycleValue: args["cycleValue"],
            periodValue: args["periodValue"],
            regularly: args["regularly"],
            tracking: args["tracking"],
          );
        },
        transition: Transition.rightToLeft),

    //女性健康目标设置
    GetPage(
        name: PageIndex.targetSettingPage,
        page: () {
          final args = Get.arguments as int;
          return TargetSettingPage(tracking: args);
        },
        transition: Transition.rightToLeft),

    //女性健康说明选择
    GetPage(
        name: PageIndex.explainSelectPage,
        page: () => ExplainSelectPage(),
        transition: Transition.rightToLeft),

    //女性健康环形说明
    GetPage(
        name: PageIndex.circularExplainPage,
        page: () => CircularExplainPage(),
        transition: Transition.rightToLeft),

    //女性健康图表说明
    GetPage(
        name: PageIndex.chartExplainPage,
        page: () => ChartExplainPage(),
        transition: Transition.rightToLeft),
  ];
}

